/**
 * Copyright (c) 快宝网络 kuaidihelp.com Co., Ltd. All Rights Reserved 禁止外泄以及用于其它的商业用途
 */

import { Request, Response } from 'express';
import { ResponseItem, responseSuccess } from '../utils';
import type { TableListItem } from '@/pages/vehicleCall/register/index.d';
import Mock from 'mockjs';

const Random = Mock.Random;
export default {
  'POST /queuecall/LogisticsCenter/list': (req: Request, res: Response) => {
    const data: TableListItem[] = Mock.mock({
      'list|1-30': [
        {
          id: '@id()',
          name: Random.cname(),
          mobile: Random.cname(),
          contact_mobile: Random.cname(),
          address: Random.cname(),

          logistics_center_name: Random.cname(),
          logistics_center_province: '上海市',
          logistics_center_city: '上海市',
          logistics_center_disctrict: '徐汇区',
          logistics_center_address:
            '啊电量监控哭了吗佳佳到家了佳佳到家了快看看啊电量监控哭了吗佳佳到家了佳佳到家了快看看',
          create_time: '2022-05-17 14:49:50',
          audit_time: '2022-05-17 14:49:50',
          'status|1-3': 3,
        },
      ],
    });

    const result: ResponseItem = {
      code: 0,
      msg: '成功',
      data: {
        ...data,
        total: data.list.length,
        qrCode:
          'https://osscdn-kbad.kuaidihelp.com/admin/ad/2022/05/09/62788b27d1949/WechatIMG45.png',
      },
    };
    return res.json(result);
  },
  'POST /queuecall/LogisticsCenter/audit': (req: Request, res: Response) =>
    responseSuccess(req, res),
  'POST /queuecall/LogisticsCenter/logisticsCenterRegisterQrcode': (
    req: Request,
    res: Response,
  ) => {
    const result: ResponseItem = {
      code: 0,
      msg: '成功',
      data: 'https://osscdn-kbad.kuaidihelp.com/admin/ad/2022/05/09/62788b27d1949/WechatIMG45.png',
    };
    return res.json(result);
  },
};
